package com.geqian.web.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.geqian.common.common.PageRequest;
import com.geqian.common.common.PageResult;
import com.geqian.common.common.ResponseResult;
import com.geqian.web.common.dto.LoginDTO;
import com.geqian.web.common.dto.RegisterDTO;
import com.geqian.web.common.dto.RoleDto;
import com.geqian.web.common.vo.VerificationCodeVo;
import com.geqian.web.entity.User;
import com.geqian.web.pojo.Location;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import javax.servlet.http.HttpServletRequest;

/**
* @author Administrator
* @description 针对表【sys_user(用户表)】的数据库操作Service
* @createDate 2023-01-12 14:25:06
*/
public interface UserService extends IService<User> {

    ResponseResult<Object> login(LoginDTO loginDTO);

    ResponseResult<String> logout();

    PageResult<User> pageSearch(PageRequest pageRequest);

    ResponseResult<User> userInfo(String token);

    ResponseResult<Object> deleteUser(Long userId);

    ResponseResult<Object> updateUser(MultipartHttpServletRequest request);

    ResponseResult<Object> addUser(MultipartHttpServletRequest request);

    ResponseResult<Object> registerUser(RegisterDTO registerDTO);

    ResponseResult<Object> grantRole(RoleDto roleDto,String token);

    ResponseResult<Object> updatePassword(String srcPassword, String newPassword, String token);

    ResponseResult<Location> getIpLocation(HttpServletRequest request);

    ResponseResult<VerificationCodeVo> getVerificationCode();
}
